package com.gebiafu.mapper;

import com.gebiafu.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * title: UserMapper
 * author: Gebiafu
 * date: 2021/07/02 10:56
 */
@Mapper
public interface UserMapper {
    //登录查询
    @Select("select id,username,name,password,authorities " +
            "from f_user where username=#{username}")
    User selectUser(String username);
    //注册添加
    @Insert("insert into f_user(id,username,name,password,authorities) "+
            "values(default,#{username},#{name},#{password},#{authorities})")
    int insertUser(User user);
}
